<template>
    <div class="collectionBox">
        <div class="head">AGV收垃圾任务派发</div>
        <div class="colBody flex">
            <el-button type="primary" class="collBtn" icon="el-icon-truck" circle :disabled="disabledBtn" @click="dispatchAGV"></el-button>
            <p>任务派发</p>
        </div>
    </div>    
</template>

<script>
import { navTrack} from "../../js/trajectory"
export default {
    name: 'collection',
    components:{
        
    },
    data(){
        return{
            disabledBtn: false
        }
    },

    //计算属性
    watch:{
        "$store.state.navControlStatus": function(val){
            if(val == 0 || val == 4){
                this.disabledBtn = false;
            }else{
                this.disabledBtn = true;
            }
        }
    },

    mounted(){
        
    },

    methods:{
        dispatchAGV: function(){
            navTrack("Collection_Path_120s");
            this.$notify({
                title: '成功',
                message: '任务派发成功',
                type: 'success'
            });
        }
    }
}
</script>

<style scoped lang="less">
    .collectionBox{
        position: relative;
        color: #303133;
        .head{
            position: fixed;
            z-index: 1998;
            background: #ffffff;
            width: 100%;
            height: 6vh;
            line-height: 6vh;
            text-align: center;
            font-size: 20px;
            
        }
        .colBody{
            height: 94vh;
            flex-direction: column;
            font-size: 30px;
            .collBtn{
                box-shadow: 0 0 6px rgba(0, 0, 0, .04)
            }
            button{
                margin-bottom: 10px;
                font-size: 170px;
            }
        }
    }
</style>